import * as mongoose from 'mongoose';

/**后台用户模型 */
export const AdminUserModel = new mongoose.Schema({
	nickName:{
        type:String,
        default:""
    },
    userName:{
        type:String,
        default:""
    },
    passWord:{
        type:String,
        default:"",
        select:false
    },
    userType:{
        type:String,
        default:"1",
    },
    avatarUrl:{
        type:String,
        default:""
    },
    gender:{
        type:Number,
        default:0
    },
    realName:{
        type:String,
        default:""
    },
    phone:{
        type:String,
        default:""
    },
	access:{
		type:[String],
		default:[]
	},
    status:{
        type:String,
        default:"0"
    }
},{
    timestamps: {
        createdAt: 'createdAt',
        updatedAt: 'updatedAt'
    }
});
export interface AdminUser extends Document {
	readonly _id: string;
	/**用户昵称 */
	readonly nickName: string;
	/**登录账号 */
	readonly userName: string;
	/**用户密码 */
	readonly passWord: string;
	/**用户类型 */
	readonly userType: string;
	/**用户头像 */
	readonly avatarUrl: string;
	/**用户性别 0未知 1男 2女 */
	readonly gender: Number;
	/**真实姓名 */
	readonly realName: string;
	/**手机号码 */
	readonly phone: string;
	/**权限列表 */
	readonly access: string[];
	/**状态 */
	readonly status: string;
}
